﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using SMARTHOTEL.RoomNum;
using SMARTHOTEL.Routses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;

namespace SMARTHOTEL.Routsese
{
    /// <summary>
    /// 路由接口
    /// </summary>
    [ApiExplorerSettings(GroupName = "v2")]
    public class RoutsesQuery : ApplicationService, IRoutses
    {


        /// <summary>
        /// 查询路由
        /// </summary>
        /// <returns></returns>
        [HttpGet("api/v1/menus/routes")]
        public Task<ResultDto<List<RouteDto>>> GetRoutes()
        {
            var routes = new List<RouteDto>
    {
        new RouteDto
        {
            Path = "/system",
            Component = "Layout",
             Name= "Role",
            Meta = new RouteMeta
            {
                Title = "系统管理",
                Icon = "setting",
                Hidden= false,
                KeepAlive= true,
                AlwaysShow = false,
                Params= null
            },
            Children = new List<RouteDto>
            {
                new RouteDto
                {
                    Path = "user",
                    Component = "/system/user/index",
                    Name= "User",
                    Meta = new RouteMeta { 
                        Title = "用户管理",
                        Icon = "el-icon-User",
                        Hidden= false,
                        KeepAlive= true,
                        AlwaysShow= false,
                        Params= null 
                    }
                },
                new RouteDto
                {
                    Path = "role",
                    Component = "/system/role/index",
                    Name= "Role",
                    Meta = new RouteMeta { 
                        Title = "角色管理",
                        Icon = "el-icon-Role",
                        Hidden= false,
                        KeepAlive= true,
                        AlwaysShow= false,
                        Params= null }
                },
                new RouteDto
                {
                    Path = "permissions",
                    Component = "/system/permissions/index",
                       Name= "Permissions",
                    Meta = new RouteMeta { 
                        Title = "权限管理",
                        Icon = "el-icon-Permissions",
                        Hidden= false,
                        KeepAlive= true,
                        AlwaysShow= false,
                        Params= null }
                }
            }
        }
    };

            return Task.FromResult(new ResultDto<List<RouteDto>>
            {
                Data = routes,
                Code = StatusCode.Success,
                Msg = "查询成功"
            });

        }
    }
}
